home *** CD-ROM | disk | FTP | other *** search
/ PC go! 2008 April / PCgo 2008-04 (DVD).iso / interface / contents / demoversionen_3846 / 13664 / files / Data1.cab / inssmobj.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-16  |  2.4 KB  |  83 lines

  1. /******************************************************************/
  2. /*                                                                */
  3. /*                      TurboCAD for Windows                      */
  4. /*                   Copyright (c) 1993 - 2001                    */
  5. /*             International Microcomputer Software, Inc.         */
  6. /*                            (IMSI)                              */
  7. /*                      All rights reserved.                      */
  8. /*                                                                */
  9. /******************************************************************/
  10.  
  11.  
  12. // Note: Proxy/Stub Information
  13. //        To build a separate proxy/stub DLL, 
  14. //        run nmake -f AALBToolps.mk in the project directory.
  15.  
  16. #include "stdafx.h"
  17. #include "resource.h"
  18. #include "InsSmObj.h"
  19.  
  20. #include "InsSmObj_i.c"
  21. #include "SmObj.h"
  22.  
  23. COleVariant varMissing((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
  24. COleVariant varTrue(1L);
  25. COleVariant varFalse(0L);
  26.  
  27. CComModule _Module;
  28.  
  29. BEGIN_OBJECT_MAP(ObjectMap)
  30.     OBJECT_ENTRY(CLSID_InsSmObj, CInsSmObj)
  31. END_OBJECT_MAP()
  32.  
  33. CInsSmObjApp theApp;
  34.  
  35. BOOL CInsSmObjApp::InitInstance()
  36. {
  37.     _Module.Init(ObjectMap, m_hInstance);
  38.     return CWinApp::InitInstance();
  39. }
  40.  
  41. int CInsSmObjApp::ExitInstance()
  42. {
  43.     _Module.Term();
  44.     return CWinApp::ExitInstance();
  45. }
  46.  
  47. /////////////////////////////////////////////////////////////////////////////
  48. // Used to determine whether the DLL can be unloaded by OLE
  49.  
  50. STDAPI DllCanUnloadNow(void)
  51. {
  52.     AFX_MANAGE_STATE(AfxGetStaticModuleState());
  53.     return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;
  54. }
  55.  
  56. /////////////////////////////////////////////////////////////////////////////
  57. // Returns a class factory to create an object of the requested type
  58.  
  59. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  60. {
  61.     return _Module.GetClassObject(rclsid, riid, ppv);
  62. }
  63.  
  64. /////////////////////////////////////////////////////////////////////////////
  65. // DllRegisterServer - Adds entries to the system registry
  66.  
  67. STDAPI DllRegisterServer(void)
  68. {
  69.     // registers object, typelib and all interfaces in typelib
  70.     return _Module.RegisterServer(TRUE);
  71. }
  72.  
  73. /////////////////////////////////////////////////////////////////////////////
  74. // DllUnregisterServer - Removes entries from the system registry
  75.  
  76. STDAPI DllUnregisterServer(void)
  77. {
  78.     _Module.UnregisterServer();
  79.     return S_OK;
  80. }
  81.  
  82.  
  83.